package Year2021.month10.Day21.Day27;

public class Car extends Automobile {
    private String tpye;//型号;
    public double money1;

    public Car(String name, String licensePlate, int dailyRent, String currentState, String tpye) {
        super(name, licensePlate, dailyRent, currentState);
        this.tpye = tpye;
    }


    public String getTpye() {
        return tpye;
    }

    public void setTpye(String tpye) {
        this.tpye = tpye;
    }

    @Override
    public void show() {
        System.out.println("轿车"+"\t"+getName()+getTpye()+"\t"+"车牌号为"+getLicensePlate()
                +"\t"+"日租金为"+getDailyRent()+"元"+"\t"+super.getCurrentState());

    }

    @Override
    public double money(int days) {
        if (days>150){
           money1= days*getDailyRent()*0.7;
           return money1;

        }else if (days>30){
            money1=days*getDailyRent()*0.8;
            return money1;
        }else if (days>7){
           money1= days*getDailyRent()*0.9;
           return money1;
        }
        return days*getDailyRent();


    }
}
